package com.rd.student.jiaji.class2.duyukun;

//import com.zrrd.test1.Park;

import java.util.Scanner;

public class test {
    public static void print() throws InterruptedException {
        Thread t1 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("A");
            }
        });

        Thread t2 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("B");
            }
        });

        Thread t3 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("C");
            }
        });

        t1.start();
        t1.join();//使用join相当于将多线程回归单线程执行
        t2.start();
        t2.join();
        t3.start();
    }

    public static void main(String[] args) throws InterruptedException {
        System.out.println("请输入循环次数：");
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();

        for (int i = 0; i < num; i++) {
            Thread.sleep(1000);
            print();
        }




        }
    }

